
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>章节七:flask-Cookie · 组团学</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="李航老师">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-lou/lou.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="chapter8.html" />
    
    
    <link rel="prev" href="chapter6.html" />
    

    </head>
    <body>
         

<div class="book">
  <div class="header-inner">
    <!-- LOGO -->
    <div class="logo"></div>
    <span class="title"></span>

    <!-- Search -->
    
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>


    <!-- Nav -->
    <ul class="header-nav">
      <li>
        <a href="https://space.bilibili.com/378936143" target="_blank">B站</a>
      </li><li>
        <a href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIzMjY0NjU5Ng==&scene=124#wechat_redirect" target="_blank">公众号</a>
      </li><li>
        <a href="https://edu.csdn.net/course/detail/32032" target="_blank">CSDN</a>
      </li>
    </ul>
  </div>

  <div class="book-summary">
    <div class="book-summary-title">文档目录</div>
     
    <nav role="navigation">


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    c语言程序设计
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../c/chapter1.html">
            
                <a href="../c/chapter1.html">
            
                    
                    章节一:初识C语言程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../c/chapter2.html">
            
                <a href="../c/chapter2.html">
            
                    
                    章节二:常用数据类型(整数)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../c/chapter3.html">
            
                <a href="../c/chapter3.html">
            
                    
                    章节三:常用数据类型(浮点型)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../c/chapter4.html">
            
                <a href="../c/chapter4.html">
            
                    
                    章节四:数据类型转换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../c/chapter5.html">
            
                <a href="../c/chapter5.html">
            
                    
                    章节五:运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../c/chapter6.html">
            
                <a href="../c/chapter6.html">
            
                    
                    章节六:选择结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../c/chapter7.html">
            
                <a href="../c/chapter7.html">
            
                    
                    章节七:switch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="../c/chapter8.html">
            
                <a href="../c/chapter8.html">
            
                    
                    章节八:for循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="../c/chapter9.html">
            
                <a href="../c/chapter9.html">
            
                    
                    章节九:嵌套for循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="../c/chapter10.html">
            
                <a href="../c/chapter10.html">
            
                    
                    章节十:强化练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.11" data-path="../c/chapter11.html">
            
                <a href="../c/chapter11.html">
            
                    
                    章节十一:数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.12" data-path="../c/chapter12.html">
            
                <a href="../c/chapter12.html">
            
                    
                    章节十二:数组函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.13" data-path="../c/chapter13.html">
            
                <a href="../c/chapter13.html">
            
                    
                    章节十三:函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    html基础
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../html/Html基础标签1.html">
            
                <a href="../html/Html基础标签1.html">
            
                    
                    章节一:Html基础标签1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../html/Html基础标签2.html">
            
                <a href="../html/Html基础标签2.html">
            
                    
                    章节二:Html基础标签2
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    Flask Web开发
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    章节一:flask框架入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="chapter2.html">
            
                <a href="chapter2.html">
            
                    
                    章节二:模版渲染
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="chapter3.html">
            
                <a href="chapter3.html">
            
                    
                    章节三:html基本标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="chapter4.html">
            
                <a href="chapter4.html">
            
                    
                    章节四:项目拆分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="chapter5.html">
            
                <a href="chapter5.html">
            
                    
                    章节五:路由参数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="chapter6.html">
            
                <a href="chapter6.html">
            
                    
                    章节六:请求与响应
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.7" data-path="chapter7.html">
            
                <a href="chapter7.html">
            
                    
                    章节七:flask-Cookie
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="chapter8.html">
            
                <a href="chapter8.html">
            
                    
                    章节八:模型数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="chapter9.html">
            
                <a href="chapter9.html">
            
                    
                    章节九:单表-增删查改一
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.10" data-path="chapter10.html">
            
                <a href="chapter10.html">
            
                    
                    章节十:单表-增删查改二
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.11" data-path="chapter11.html">
            
                <a href="chapter11.html">
            
                    
                    章节十一:图书管理系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    gitbook文档搭建
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../book/chapter1.html">
            
                <a href="../book/chapter1.html">
            
                    
                    章节一:环境安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../book/chapter2.html">
            
                <a href="../book/chapter2.html">
            
                    
                    章节二:typora使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../book/chapter3.html">
            
                <a href="../book/chapter3.html">
            
                    
                    章节三:电子书搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../book/chapter4.html">
            
                <a href="../book/chapter4.html">
            
                    
                    章节四:插件安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../book/chapter5.html">
            
                <a href="../book/chapter5.html">
            
                    
                    章节五:部署
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>

</nav>
     
  </div>

  <!-- Content nav -->
  <div class="book-anchor">
    <div class="book-anchor-title"></div>

    <div class="book-anchor-body"></div>
  </div>

  <div class="book-body">
    
    <div class="body-inner">
       

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >章节七:flask-Cookie</a>
    </h1>
</div>



      <div class="page-wrapper" tabindex="-1" role="main">
        <div class="page-inner">
          
<div id="book-search-results">
    <div class="search-noresults">
    
          <section class="normal markdown-section">
             <h2 id="&#x5B66;&#x4E60;&#x76EE;&#x6807;">&#x5B66;&#x4E60;&#x76EE;&#x6807;</h2>
<ul>
<li>&#x4E86;&#x89E3;&#x5BA2;&#x6237;&#x7684;&#x4F1A;&#x8BDD;&#x6280;&#x672F;</li>
<li>&#x4E86;&#x89E3;cookie&#x7684;&#x7279;&#x70B9;</li>
<li>&#x4E86;&#x89E3;cookie&#x7684;&#x7279;&#x6027;</li>
<li>&#x638C;&#x63E1;cookie&#x7684;&#x4F7F;&#x7528;</li>
</ul>
<h2 id="cookie&#x4ECB;&#x7ECD;">cookie&#x4ECB;&#x7ECD;</h2>
<ol>
<li>&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x4F1A;&#x8BDD;&#x6280;&#x672F;</li>
</ol>
<p>cookie&#x672C;&#x8EAB;&#x7531;&#x6D4F;&#x89C8;&#x5668;&#x4FDD;&#x5B58;&#xFF0C;&#x901A;&#x8FC7;Response&#x5C06;cookie&#x5199;&#x5230;&#x6D4F;&#x89C8;&#x5668;&#x4E0A;&#xFF0C;&#x4E0B;&#x4E00;&#x6B21;&#x8BBF;&#x95EE;&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x4F1A;&#x6839;&#x636E;&#x4E0D;&#x540C;&#x7684;&#x89C4;&#x5219;&#x643A;&#x5E26;cookie&#x8FC7;&#x6765;</p>
<ol>
<li>&#x7279;&#x70B9;</li>
</ol>
<p>&#x5BA2;&#x6237;&#x7AEF;&#x4F1A;&#x8BDD;&#x6280;&#x672F;&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x4F1A;&#x8BDD;&#x6280;&#x672F;</p>
<p>&#x6570;&#x636E;&#x5168;&#x90FD;&#x662F;&#x5B58;&#x50A8;&#x5728;&#x5BA2;&#x6237;&#x7AEF;&#x4E2D;</p>
<p>&#x5B58;&#x50A8;&#x4F7F;&#x7528;&#x7684;&#x952E;&#x503C;&#x5BF9;&#x7ED3;&#x6784;&#x8FDB;&#x884C;&#x7684;&#x5B58;&#x50A8;</p>
<ol>
<li>&#x7279;&#x6027;</li>
</ol>
<p>1.&#x652F;&#x6301;&#x8FC7;&#x671F;&#x65F6;&#x95F4;</p>
<p>2.&#x9ED8;&#x8BA4;&#x4F1A;&#x81EA;&#x52A8;&#x643A;&#x5E26;&#x672C;&#x7F51;&#x7AD9;&#x7684;&#x6240;&#x6709;cookie</p>
<p>3.&#x6839;&#x636E;&#x57DF;&#x540D;&#x8FDB;&#x884C;cookie&#x5B58;&#x50A8;</p>
<p>4&#x4E0D;&#x80FD;&#x8DE8;&#x57DF;&#x540D;</p>
<p>5.&#x4E0D;&#x80FD;&#x8DE8;&#x6D4F;&#x89C8;&#x5668;</p>
<p>6.cookie&#x662F;&#x901A;&#x8FC7;&#x670D;&#x52A1;&#x5668;&#x521B;&#x5EFA;&#x7684;Response&#x6765;&#x521B;&#x5EFA;&#x7684;</p>
<ol>
<li>cookie&#x7684;&#x4F7F;&#x7528;</li>
</ol>
<p>response.set_cookie(key,value[ ,max_age=None,exprise=None])</p>
<p>max_age:&#x6574;&#x6570;&#xFF0C;&#x6307;&#x5B9A;cookie&#x8FC7;&#x671F;&#x65F6;&#x95F4;</p>
<p>expries:&#x6574;&#x6570;&#xFF0C;&#x6307;&#x5B9A;&#x8FC7;&#x671F;&#x65F6;&#x95F4;&#xFF0C;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x5177;&#x4F53;&#x65E5;&#x671F;&#x65F6;&#x95F4;</p>
<p>max_age&#x548C;expries&#x4E24;&#x4E2A;&#x9009;&#x4E00;&#x4E2A;&#x6307;&#x5B9A;</p>
<h2 id="&#x6A21;&#x62DF;&#x767B;&#x5F55;&#x4E0E;&#x6CE8;&#x9500;">&#x6A21;&#x62DF;&#x767B;&#x5F55;&#x4E0E;&#x6CE8;&#x9500;</h2>
<p>&#x7F16;&#x5199;&#x767B;&#x5F55;&#x9875;&#x9762;login.html</p>
<blockquote>
<p><code></code> &#x663E;&#x793A;&#x7528;&#x6237;&#x540D;&#x6216;&#x5BC6;&#x7801;&#x9519;&#x8BEF;&#x4FE1;&#x606F;</p>
<p>action=&quot;/login&quot; &#x8BF7;&#x6C42;&#x8DEF;&#x5F84;</p>
<p>method=&quot;post&quot; &#x8BF7;&#x6C42;&#x65B9;&#x5F0F;</p>
</blockquote>
<pre><code class="lang-py">&lt;form action=&quot;/login&quot; method=&quot;post&quot;&gt;
    &lt;h3 style=&quot;color: red&quot;&gt;{{ msg }}&lt;/h3&gt;
    &lt;p&gt;&#x7528;&#x6237;:&lt;input type=&quot;text&quot; name=&quot;username&quot;/&gt;  &lt;/p&gt;
    &lt;p&gt;&#x5BC6;&#x7801;:&lt;input type=&quot;password&quot; name=&quot;password&quot;/&gt;  &lt;/p&gt;
    &lt;p&gt;
        &lt;input type=&quot;submit&quot; value=&quot;&#x767B;&#x5F55;&quot;/&gt;
        &lt;a href=&quot;/home&quot;&gt;&#x8FDB;&#x5165;&#x5230;&#x9996;&#x9875;&lt;/a&gt;
    &lt;/p&gt;
&lt;/form&gt;
</code></pre>
<p>&#x70B9;&#x51FB;&#x767B;&#x5F55;&#x6309;&#x94AE;&#xFF0C;&#x8FDB;&#x5165;&#x5230;views&#x9875;&#x9762;</p>
<p>redirect&#x91CD;&#x5B9A;&#x5411;&#x9700;&#x8981;&#x5BFC;&#x5305;</p>
<p>rep=redirect(&apos;/home&apos;) &#x767B;&#x5F55;&#x6210;&#x529F;&#x4E4B;&#x540E;&#xFF0C;&#x91CD;&#x5B9A;&#x5411; &#xFF0C;&#x53D1;&#x9001;&#x8BF7;&#x6C42;/home</p>
<pre><code class="lang-py"><span class="hljs-comment">#&#x767B;&#x5F55;</span>
<span class="hljs-meta">@blue.route(&apos;/login&apos;,methods=[&apos;POST&apos;,&apos;GET&apos;])</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">login</span><span class="hljs-params">()</span>:</span>
    <span class="hljs-comment">#&#x901A;&#x8FC7;request&#x5BF9;&#x8C61;&#x83B7;&#x53D6;&#x7528;&#x6237;&#x540D;&#x548C;&#x5BC6;&#x7801;</span>
    username=request.form.get(<span class="hljs-string">&apos;username&apos;</span>)
    password=request.form.get(<span class="hljs-string">&apos;password&apos;</span>)
    <span class="hljs-comment">#&#x5047;&#x8BBE;&#x7528;&#x6237; tom  &#x5BC6;&#x7801; 123</span>
    <span class="hljs-keyword">if</span> username==<span class="hljs-string">&apos;tom&apos;</span> <span class="hljs-keyword">and</span> password==<span class="hljs-string">&apos;123&apos;</span>:
        <span class="hljs-comment">#&#x767B;&#x5F55;&#x6210;&#x529F;=&#x300B;&#x4FDD;&#x5B58;&#x7528;&#x6237;&#x4FE1;&#x606F;(cookie)=&#x300B;&#x8DF3;&#x8F6C;&#x9996;&#x9875;</span>
        <span class="hljs-comment">#cookie&#x662F;&#x7531;response&#x5BF9;&#x8C61;&#x521B;&#x5EFA;&#x7684;</span>
        rep=redirect(<span class="hljs-string">&apos;/home&apos;</span>)
        <span class="hljs-comment">#&#x53C2;&#x6570;1&#xFF1A;cookie&#x540D;&#xFF0C;&#x53C2;&#x6570;2&#xFF1A;cookie&#x503C;&#xFF0C; &#x53C2;&#x6570;3&#xFF1A;&#x8FC7;&#x671F;&#x65F6;&#x95F4;</span>
        rep.set_cookie(<span class="hljs-string">&apos;cname&apos;</span>,username,max_age=<span class="hljs-number">60</span>*<span class="hljs-number">3</span>)
        <span class="hljs-keyword">return</span> rep
    <span class="hljs-keyword">else</span>:
        <span class="hljs-comment">#&#x767B;&#x5F55;&#x5931;&#x8D25;=&#x300B;&#x8DF3;&#x8F6C;&#x5230;&#x767B;&#x5F55;&#x9875;&#x9762;&#x663E;&#x793A;&#x9519;&#x8BEF;&#x4FE1;&#x606F;</span>
        <span class="hljs-keyword">return</span> render_template(<span class="hljs-string">&apos;login.html&apos;</span>,msg=<span class="hljs-string">&apos;&#x5BC6;&#x7801;&#x9519;&#x8BEF;&apos;</span>)

<span class="hljs-comment">#&#x8FDB;&#x5165;&#x9996;&#x9875;</span>
<span class="hljs-meta">@blue.route(&apos;/home&apos;)</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">home</span><span class="hljs-params">()</span>:</span>
    <span class="hljs-comment">#&#x4ECE;cookie&#x4E2D;&#x83B7;&#x53D6;&#x7528;&#x6237;&#x4FE1;&#x606F;</span>
    name=request.cookies.get(<span class="hljs-string">&apos;cname&apos;</span>)
    <span class="hljs-keyword">return</span> render_template(<span class="hljs-string">&apos;home.html&apos;</span>,name=name)

<span class="hljs-comment">#&#x9000;&#x51FA;&#x767B;&#x5F55;</span>
<span class="hljs-meta">@blue.route(&apos;/outLogin&apos;)</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">outLogin</span><span class="hljs-params">()</span>:</span>
    <span class="hljs-comment">#&#x5220;&#x9664;cookie==&#x300B;&#x8FD4;&#x56DE;&#x5230;&#x767B;&#x5F55;&#x9875;&#x9762;</span>
    rep=redirect(<span class="hljs-string">&apos;/&apos;</span>)
    rep.delete_cookie(<span class="hljs-string">&apos;cname&apos;</span>)
    <span class="hljs-keyword">return</span> rep
</code></pre>
<p>&#x7F16;&#x5199;&#x9996;&#x9875;&#x9875;&#x9762;home.html</p>
<pre><code class="lang-py">&lt;h3&gt;&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x9996;&#x9875;&lt;/h3&gt;
{% if name %}
&lt;h3&gt;&#x7528;&#x6237;&#x4FE1;&#x606F;:{{ name }}&lt;/h3&gt;
&lt;h3&gt;&lt;a href=&quot;/outLogin&quot;&gt;&#x9000;&#x51FA;&#x767B;&#x5F55;&lt;/a&gt;  &lt;/h3&gt;

{% else %}
    &lt;a href=&quot;/&quot;&gt;&#x8BF7;&#x5148;&#x767B;&#x5F55;&lt;/a&gt;
{% endif %}
</code></pre>
 
          </section>
          
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>
 
        </div>
      </div>
      
    </div>

     
    <a
      href="chapter6.html"
      class="navigation navigation-prev "
      aria-label="Previous page: 章节六:请求与响应"
    >
      <i class="fa fa-angle-left"></i>
    </a>
     
    <a
      href="chapter8.html"
      class="navigation navigation-next "
      aria-label="Next page: 章节八:模型数据"
    >
      <i class="fa fa-angle-right"></i>
    </a>
      
  </div>
  <script>
    function showModal() {
      document.getElementsByClassName("mask")[0].style.display = "block";
      document.getElementsByClassName("donate-modal")[0].style.display =
        "block";
    }
    // 切换赞赏码
    function showDonateImg(num) {
      let alipay = "";
      let wxpay = ""
      if(num){
        wxpay = "hidden"
      }else{
        alipay = "hidden"
      }
      document.getElementById("wxpay-code").hidden = wxpay;
      document.getElementById("alipay-code").hidden = alipay;
      document.getElementsByName("pay-way")[num].checked = "checked";
    }

    // 关闭赞赏框
    function closeDonateModal() {
      document.getElementsByClassName("mask")[0].style.display = "none";
      document.getElementsByClassName("donate-modal")[0].style.display = "none";
    }

    var gitbook = gitbook || [];
    gitbook.push(function () {
      gitbook.page.hasChanged({"page":{"title":"章节七:flask-Cookie","level":"1.4.7","depth":2,"next":{"title":"章节八:模型数据","level":"1.4.8","depth":2,"path":"flask/chapter8.md","ref":"flask/chapter8.md","articles":[]},"previous":{"title":"章节六:请求与响应","level":"1.4.6","depth":2,"path":"flask/chapter6.md","ref":"flask/chapter6.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-sharing","-search","-favicon","code","expandable-chapters","theme-lou","back-to-top-button","search-pro","flexible-alerts","chapter-fold","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"livereload":{},"search-pro":{},"code":{"copyButtons":true},"theme-lou":{"hide-elements":[".summary .gitbook-link"],"color":"#2096FF","copyright":{"author":"李航老师"},"forbidCopy":true,"logo":"assets/logo.png","titleColor":{"h1":"#8b008b","h2":"#20b2aa","h3":"#a52a2a"},"search-placeholder":"众里寻他千百度","copyrightLogo":"assets/copyright.png","favicon":"assets/favicon.ico","autoNumber":3},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"back-to-top-button":{},"flexible-alerts":{"style":"callout","note":{"label":"Note","icon":"fa fa-info-circle","className":"info"},"tip":{"label":"Tip","icon":"fa fa-lightbulb-o","className":"tip"},"warning":{"label":"Warning","icon":"fa fa-exclamation-triangle","className":"warning"},"danger":{"label":"Attention","icon":"fa fa-ban","className":"danger"}},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"李航老师","lang":"zh-cn","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"themeLou":{"nav":[{"target":"_blank","url":"https://space.bilibili.com/378936143","name":"B站"},{"target":"_blank","url":"https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzIzMjY0NjU5Ng==&scene=124#wechat_redirect","name":"公众号"},{"target":"_blank","url":"https://edu.csdn.net/course/detail/32032","name":"CSDN"}]}},"title":"组团学","gitbook":"*","description":"Gitbook电子书示例项目"},"file":{"path":"flask/chapter7.md","mtime":"2023-11-14T02:56:38.648Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-12-28T06:53:31.689Z"},"basePath":"..","book":{"language":""}});
    });
  </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/jweixin-1.6.0.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/lou.js"></script>
        
    

    </body>
</html>

